/************************************************************************
                                                                     
   Xceed Ultimate ListBox for Silverlight                                                                                                                                            
   Copyright (C) 2010 Xceed Software Inc.    
                                                                     
   This program is provided to you under the terms of the GNU General Public  
   License version 2 as published by the Free Software Foundation. 
        
   This program is distributed in the hope that it will be useful, but
   WITHOUT ANY WARRANTY, without even the implied warranty of 
   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
   General Public License for more details.

   You should have received a copy of the GNU General Public License along 
   with this program, if not, write to the Free Software Foundation, Inc., 
   51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.

   This program can be provided to you by Xceed Software Inc. under a
   proprietary commercial license agreement for use in non-Open Source
   projects. Visit Xceed.com to find the commercial edition of 
   Xceed Ultimate ListBox for Silverlight.                                    
                                                                      
 **********************************************************************/

using System.Windows;

// This source code obtained from CodeProject and 
// the URL is http://www.codeproject.com/KB/silverlight/TextOnAPathSilverlight.aspx?msg=2872095.
namespace Xceed.Silverlight.Utils
{
  internal class RectHelper
  {
    public RectHelper( Rect input )
    {
      m_value = input;
    }

    public Rect Value
    {
      get
      {
        return m_value;
      }
      set
      {
        m_value = value;
      }
    }

    // Summary:
    //     Gets the position of the top-left corner of the rectangle.
    //
    // Returns:
    //     The position of the top-left corner of the rectangle.
    public Point TopLeft
    {
      get
      {
        return ( new Point( m_value.X, m_value.Y ) );
      }
    }

    //
    // Summary:
    //     Gets the position of the top-right corner of the rectangle.
    //
    // Returns:
    //     The position of the top-right corner of the rectangle.
    public Point TopRight
    {
      get
      {
        return ( new Point( m_value.X + m_value.Width, m_value.Y ) );
      }
    }

    //
    // Summary:
    //     Gets the position of the bottom-left corner of the rectangle
    //
    // Returns:
    //     The position of the bottom-left corner of the rectangle.
    public Point BottomLeft
    {
      get
      {
        return ( new Point( m_value.X, m_value.Y + m_value.Height ) );
      }
    }

    //
    // Summary:
    //     Gets the position of the bottom-right corner of the rectangle.
    //
    // Returns:
    //     The position of the bottom-right corner of the rectangle.
    public Point BottomRight
    {
      get
      {
        return ( new Point( m_value.X + m_value.Width, m_value.Y + m_value.Height ) );
      }
    }

    private Rect m_value;
  }
}
